package www.way2inbox.font;

import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.TextView;
import java.lang.reflect.Field;

public class CustomFont_Textview extends TextView {
	Context context;
	

public CustomFont_Textview(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    this.context= context;
//    init();
}

public CustomFont_Textview(Context context, AttributeSet attrs) {
    super(context, attrs);
    this.context= context;
//    init();
}

public CustomFont_Textview(Context context) {
    super(context);
    this.context= context;
//    init();
}
    	@Override
	    public void setTypeface(Typeface tf, int style) {

	        //This is to override eclipse error messages
	        if (!super.isInEditMode()) {      

	            if (style == Typeface.BOLD) { 
	                super.setTypeface(Typefaces.getTypeFace(getContext(), "fonts/Roboto-Bold.ttf"));
	                
	            }else if (style == Typeface.NORMAL){
	                super.setTypeface(Typefaces.getTypeFace(getContext(), "fonts/Roboto-Light.ttf"));
	            }else{
	                super.setTypeface(Typefaces.getTypeFace(getContext(), "fonts/Roboto-Regular.ttf"));
	            }
	        } 
	    }
}